import { createApp } from 'vue'
import { createPinia } from 'pinia'
import Vconsole from 'vconsole'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'; // 引入中文语言包
import 'animate.css/animate.min.css'
import '@/assets/style/main.less'
import 'element-plus/dist/index.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

const app = createApp(App)

if (import.meta.env.VITE_ENV !== 'production') {
  new Vconsole()
}

app.use(createPinia())
app.use(router)
// 全局注册 ElementPlus 图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(ElementPlus, {
  locale: zhCn, // 设置语言为中文
}) // 注册 Element Plus 组件库
app.mount('#app')
